<?php

function validateEmail($email)
{
    $emailPattern = "/^[a-zA-Z0-9.!#$%&’*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/";
    return (preg_match($emailPattern, $email));
}

function validateUsername($username)
{
    $usernamePattern = "/^[\\w&\\- ]+$/";
    return (preg_match($usernamePattern, $username));
}

function validatePassword($password)
{
    $passwordPattern = "/^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$/";
    return preg_match($passwordPattern, $password);
}
